//
//	MainDetialModel.swift
//
//	Create by 松 松 on 24/5/2019
//	Copyright © 2019. All rights reserved.
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport

import Foundation


open class MainDetialModel : NSObject, NSCoding, SSMap{

	public var appCode : String?
	public var id : String?
	public var isImpose : Int?
	public var mainTypeColor : String?
	public var typeCode : String?
	public var typeName : String?


	/**
	 * Instantiate the instance using the passed dictionary values to set the properties values
	 */
    required public init(fromDictionary dictionary: [String:Any]){
		appCode = dictionary["appCode"] as? String
		id = dictionary["id"] as? String
		isImpose = dictionary["isImpose"] as? Int
		mainTypeColor = dictionary["mainTypeColor"] as? String
		typeCode = dictionary["typeCode"] as? String
		typeName = dictionary["typeName"] as? String
	}

	/**
	 * Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
	 */
    public func toDictionary() -> [String:Any]
	{
		var dictionary = [String:Any]()
		if appCode != nil{
			dictionary["appCode"] = appCode
		}
		if id != nil{
			dictionary["id"] = id
		}
		if isImpose != nil{
			dictionary["isImpose"] = isImpose
		}
		if mainTypeColor != nil{
			dictionary["mainTypeColor"] = mainTypeColor
		}
		if typeCode != nil{
			dictionary["typeCode"] = typeCode
		}
		if typeName != nil{
			dictionary["typeName"] = typeName
		}
		return dictionary
	}

    /**
    * NSCoding required initializer.
    * Fills the data from the passed decoder
    */
    @objc required public init(coder aDecoder: NSCoder)
	{
         appCode = aDecoder.decodeObject(forKey: "appCode") as? String
         id = aDecoder.decodeObject(forKey: "id") as? String
         isImpose = aDecoder.decodeObject(forKey: "isImpose") as? Int
         mainTypeColor = aDecoder.decodeObject(forKey: "mainTypeColor") as? String
         typeCode = aDecoder.decodeObject(forKey: "typeCode") as? String
         typeName = aDecoder.decodeObject(forKey: "typeName") as? String

	}

    /**
    * NSCoding required method.
    * Encodes mode properties into the decoder
    */
    @objc public func encode(with aCoder: NSCoder)
	{
		if appCode != nil{
			aCoder.encode(appCode, forKey: "appCode")
		}
		if id != nil{
			aCoder.encode(id, forKey: "id")
		}
		if isImpose != nil{
			aCoder.encode(isImpose, forKey: "isImpose")
		}
		if mainTypeColor != nil{
			aCoder.encode(mainTypeColor, forKey: "mainTypeColor")
		}
		if typeCode != nil{
			aCoder.encode(typeCode, forKey: "typeCode")
		}
		if typeName != nil{
			aCoder.encode(typeName, forKey: "typeName")
		}

	}

}
